import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileOutputstreamDemo02 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos1 = new FileOutputStream("MyFile\\src\\tmp\\test2.txt");

        //1.一次写入一字节数据
//        fos1.write(97);
//        fos1.write(98);
//        fos1.write(99);
//        fos1.write(100);
//        fos1.write(101);

//        //2.一次写入一字节数组
          String str = "abcde";
//        fos1.write(str.getBytes());

        //3.写入字节数组中某一指定位置开始的指定位移量的数据
        fos1.write(str.getBytes(),1,4);

        fos1.close();
    }
}
